package shuzu;

public class shuzu1 {
    public static void main(String[] args) {
        int [] age ={12,6,9,8,16,14,16};
        int sum=0;
        double a;
        for (int i =0;i<age.length;i++){
            sum =sum+age[i];
        }
        a=sum * 1.0 / age.length;
        System.out.println("平均值："+a);

        int max=age[0];
        for (int i =1;i<age.length;i++){
            if (max<age[i])
                max=age[i];
        }
        System.out.println("max="+max);
        int min=age[0];
        for (int i =1;i<age.length;i++){
            if (min>age[i])
                min=age[i];
        }
        System.out.println("min="+min);


//        for (int i = 0; i < age.length; i++) {
//            System.out.println("age["+i+"]="+age[i]);
//        }
    }
}